package com.tamtamy.jtta.data.json;

import net.sf.json.JSONObject;

import com.tamtamy.jtta.data.ContentFile;
import com.tamtamy.jtta.utility.JSONUtility;

public class JSONContentFile extends ContentFile {

	private static final long serialVersionUID = 2566178501604324839L;

	public JSONContentFile(JSONObject jsonObject) {
		super();
		this.id = JSONUtility.getLong(jsonObject,"id");
		this.title = JSONUtility.getString(jsonObject,"title");
		this.description = JSONUtility.getString(jsonObject,"description");
		this.creationDate = JSONUtility.getDate(jsonObject,"creationDate");
		this.userID = JSONUtility.getString(jsonObject,"userID");
		this.languageCode = JSONUtility.getString(jsonObject,"languageCode");
		this.network = JSONUtility.getString(jsonObject,"network");
		this.permission = JSONUtility.getString(jsonObject,"permission");
		this.discussionPermission = JSONUtility.getString(jsonObject,"discussionPermission");
		this.updateDate = JSONUtility.getDate(jsonObject,"updateDate");
		this.favouriteCounter = JSONUtility.getString(jsonObject,"favouriteCounter");
		this.highlight = JSONUtility.getString(jsonObject,"highlight");
		this.numberOfComments = JSONUtility.getString(jsonObject,"numberOfComments");
		this.tags =  JSONUtility.getStringList(jsonObject,"tagList");
		this.rate = JSONUtility.getString(jsonObject,"rate");
		this.ratesNumber = JSONUtility.getString(jsonObject,"ratesNumber");
		this.commentList = JSONUtility.getStringList(jsonObject,"commentsList");
		this.views = JSONUtility.getString(jsonObject,"views");
		this.downloads = JSONUtility.getString(jsonObject,"downloads");
		this.size = JSONUtility.getString(jsonObject,"size");
		this.contentUrl = JSONUtility.getString(jsonObject,"contentUrl");
		this.contentFileName = JSONUtility.getString(jsonObject,"contentFileName");
		this.thumbnailPresent = JSONUtility.getBoolean(jsonObject,"thumbnailPresent");
		this.thumbnailSmall = JSONUtility.getString(jsonObject,"thumbnailSmall");
		this.thumbnailRect = JSONUtility.getString(jsonObject,"thumbnailRect");
		this.thumbnailMedium = JSONUtility.getString(jsonObject,"thumbnailMedium");
		this.thumbnailOriginal = JSONUtility.getString(jsonObject,"thumbnailOriginal");
		this.contentType = JSONUtility.getString(jsonObject,"contentType");
		this.contentTypeCategory = JSONUtility.getString(jsonObject,"contentTypeCategory");
		this.descriptionPlainText = JSONUtility.getString(jsonObject,"descriptionPlainText");
		this.permalink = JSONUtility.getString(jsonObject,"permalink");
	}

}
